/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年10月20日 上午10:03:55
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.moon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/mq")
public class MQController {
	@Autowired
	JmsMessagingTemplate jms;
	@RequestMapping("/send")
	@ResponseBody
	public String send(String message) {
		jms.convertAndSend("TESTQ",message);
		return "success";
	}
	@RequestMapping("/getformq")
	@ResponseBody
	public String getForMq() {
		String task = jms.receiveAndConvert("TESTQ", String.class);
		return task;
	}
}
